import * as UE from 'ue'
import { $ref, $unref, $set, argv, on, toManualReleaseDelegate, releaseManualReleaseDelegate, blueprint } from 'puerts';

let InteractionFunction = {
    InteractionStart: function () {
        console.log("ClientInteractionStart")
    },
    InteractionStop: function () {
        console.log("ClientInteractionStop")
    },
    ParticipantStart: function () {
        console.log("ClientParticipantStart")
    },
    ParticipantStop: function () {
        console.log("ClientParticipantStop")
    }
};

function RegisterInteractionFunction(Object: UE.Object, DelegateName: string, FunctionName: string): void {
    Object[DelegateName].Bind(InteractionFunction[FunctionName]);
    console.log("RegisterInteractionFunction", "DelegateName", DelegateName, "FunctionName", FunctionName);
}

let gameInstance = (argv.getByName("GameInstance") as UE.AnimSampleGameInstance);

gameInstance.NotifyRegisterInteractionFunction.Bind(RegisterInteractionFunction);